HOMEWORK 1

Settings Up

Loading Packages

# Loading Packages 

library(data.table)
library(lubridate)
library(tidyverse)
library(esquisse)
library(plyr)
library(ggplot2)
library(cowplot)
library(naniar) #for NA exploration
library(sp) #spatial data
library(ggmap) #for map
library(osmdata) #openstreetmap
library(reshape2)
library(plotly)

Loading Datas and Cleaning

Laptop_Sales_Data <- fread("DATA/LaptopSales_red.csv")

#is.data.table(Laptop_Sales_Data)

#summary(Laptop_Sales_Data)

#str(Laptop_Sales_Data)

gg_miss_var(Laptop_Sales_Data, show_pct = TRUE)

EX 3.4

a.Price Questions:

i. At What Price are the laptops actually selling ?

#### Histogram of the Retail Price of Computer In 2018

ggplot(Retail_Price_and_Dates) +
 aes(x = Retail.Price) +
 geom_histogram(bins = 30L, fill = "#1c6155") +
 labs(x = "Price", y = "Frequency", title = "Histogram of the Retail Price of Computer", subtitle = "In 2018") +
 theme_classic()

#### Boxplot of the Retail Price of Computer In 2018

ggplotly(
ggplot(Retail_Price_and_Dates) +
 aes(x = "", y = Retail.Price) +
 geom_boxplot(fill = "#1c6155") +
 labs(y = "Price", x="",
 title = "Boxplot of the Retail Price of Computer", subtitle = "In 2018") +
 theme_classic()
)
print(paste("Last Recorded Prices are", Actual_Price[1,1], "USD", "and", Actual_Price[2,1],"USD","on the same Day with a mean of",mean(Actual_Price$Retail.Price),"USD"))
## [1] "Last Recorded Prices are 406 USD and 530 USD on the same Day with a mean of 468 USD"

ii.Does price change with time?

iii. Are prices consistent across retail outlets?

iv. How does price change with configuration?

b.Location Questions

i. Where are the stores and customers locatd?

ii. Which stores are selling the most?

iii. How far stores are selling the most?

iv. How far stores are selling the most? - Alternative

c.Revenue Questions

i. How do the sales volume in each store relate to Acell’s revenues?

ii. How does this relationship depend on the configuration?

d.Configuration Questions

i. What are the details of each configuration? How does this relate to price?

ii. Do all stores sell all configurations?